<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Prefs 01</title>
</head>
<body>

<?js
const JSWS_PREF_ROOT			= "extensions.jsws.";
const JSWS_PREF_MODULES_ROOT	= JSWS_PREF_ROOT + "modules.";

var prefSvc = Cc["@mozilla.org/preferences-service;1"]
	.getService(Ci.nsIPrefService);
var prefBranch = prefSvc.getBranch(JSWS_PREF_MODULES_ROOT);
prefBranch.QueryInterface(Ci.nsIPrefBranch2);
var prefType = new Array();
prefType[prefBranch.PREF_INT] = "Integer";
prefType[prefBranch.PREF_BOOL] = "Boolean";
prefType[prefBranch.PREF_STRING] = "String";

var children = prefBranch.getChildList("", {});
response.write("Children: " + children.length + "<br>\n");
for (var i = 0; i < children.length; i++) {
	response.write(i + ": " + children[i] + " (" + prefType[prefBranch.getPrefType(children[i])] + ")<br>\n");
}

var extManager = Cc["@mozilla.org/extensions/manager;1"]
	.createInstance(Ci.nsIExtensionManager);
var extEnum = extManager.installLocations;
while (extEnum.hasMoreElements()) {
	var ext = extEnum.getNext();
	response.write(ext + "<br>\n");
}

//const extId = "jsws@chris.winberry.net";
const extId = "jswsmodule1@chris.winberry.net";
var ext = extManager.getInstallLocation(extId).getItemLocation(extId).path;
response.write(ext + "<br>\n");
?>

</body>
</html>